package lab02.test37;
import java.util.Scanner;
public class StudentDemo {
    public static void main(String[] args) {
        int i;
Scanner sc=new Scanner(System.in);
Scanner input=new Scanner(System.in);
Undergraduate undergraduate=new Undergraduate();
Graduate graduate=new Graduate();
        System.out.println("请输入本科生的姓名和成绩");
        undergraduate.name=input.nextLine();
        for (i=0;i<=2;i++){
            undergraduate.grade1[i]=sc.nextDouble();
        }
        System.out.println(undergraduate.grade());

        System.out.println("请输入研究生的姓名和成绩");
        graduate.name=input.nextLine();
        for (i=0;i<=2;i++){
            graduate.grade1[i]=sc.nextDouble();
        }
        System.out.println(graduate.grade());

    }
}
